import { post } from "../utils/axios";
import Taro from "@tarojs/taro"

class UserAPI {
  // 会员列表
	async getUserList(data) {
    const res = await post("/user/agent.User_level_card/index", data);
    return res;
  }
  // 会员详情
  async getUserDetail(data) {
    const res = await post("user/agent.User_level_card/detail",data);
    return res;
  }
  // 充值项详情
  async getOilCardsDetail(data) {
    const res = await post("/user/agent.ConfigRecharge/detail",data);
    return res;
  }
  // 会员卡选项
  async userLevelSelect() {
    var data = {
      app_id: Taro.getStorageSync('app_id')
    }
    const res = await post("user/agent.user_level/index",data);
    return res;
  }
  // 会员调级
  async userLevelSave(data) {
    const res = await post("user/agent.User_Level_card/up_grade",data);
    return res;
  }
  // 积分变动记录
  async userPointLog(data) {
    const res = await post("user/agent.user/pointLogs",data);
    return res;
  }
  // 可发送优惠券列表
  async getCouponList(data) {
    const res = await post("coupon/agent.coupon/index",data);
    return res;
  }
  // 发送优惠券
  async sendCoupon(data) {
    const res = await post("coupon/agent.coupon/provide",data);
    return res;
  }
  // 修改会员详情
  async userMsgEdit(data) {
    const res = await post("/user/agent.User/edit", data);
    return res;
  }
  // 会员账户余额/积分充值
  async userAccountEdit(data) {
    const res = await post("user/agent.User/operate_account", data);
    return res;
  }
  // 会员充值
  async rechargeSubmit(data) {
    const res = await post("user/agent.account/recharge", data);
    return res;
  }
  // 查询充值结果
  async rechargeOrderStatus(data) {
    const res = await post("user/agent.account/search_order", data);
    return res;
  }
  // 会员开卡
  async userOpenCard(data) {
    const res = await post("user/agent.User_Level_card/add_defult_user", data);
    return res;
  }
  // 会员余额Tabs
  async userTabs(data) {
    const res = await post("user/agent.user/userAccount", data);
    return res;
  }
  // 是否使用验证码
  async checkCodeStatus(data) {
    const res = await post("api/config.safe/config", data);
    return res;
  }
  // 发送验证码
  async send_sms(data) {
    const res = await post("user/agent.user/send_sms", data);
    return res;
  }
}

export default new UserAPI;